home *** CD-ROM | disk | FTP | other *** search
- Path: earth.superlink.net!usenet
- From: ananda@mars.superlink.net (Ananda Subramaniam)
- Newsgroups: comp.os.ms-windows.programmer.ole,comp.lang.c++
- Subject: Problems VC++4.0 & StringFromCLSID function
- Date: Wed, 17 Jan 1996 20:43:26 GMT
- Organization: SuperNet Inc. (908) 828-8988
- Message-ID: <4djn2d$mps@earth.superlink.net>
- NNTP-Posting-Host: p100.superlink.net
- X-Newsreader: Forte Free Agent 1.0.82
-
- Hi,
-
- I have an OLE sample that I wrote and compiled in VC++ 2.0 without any problems.
- However, when I tried to compile in VC++ 4.0, I had trouble with the
- StringFromCLSID function.
-
- I get a message "cannot convert 2nd parameter char ** to unsigned short**"
-
- The Prototype for StringFromCLSID is:
- StringFromCLSID(REFCLSID, LPOLESTR *);
-
- I am passing as my second parameter a LPSTR *, which shouldn't be a problem
- because grepping through the several include files provided by MS there is a
- typedef as follows
-
- typedef LPSTR LPOLESTR;
-
- The compiler seems to think that LPOLESTR is of type unsigned short.
- To further confirm this, I changed the type of my string to LPOLESTR and the
- compiler went past StringFromCLSID function but complained on the next line
- where I had AfxMessageBox(mystr). The compiler said "non of the 2 overloads can
- covert parameter one from type unsigned short * "
-
- After this, I went and modified the header file that has the prototype for
- StringFromCLSID (objbase.h) and modified the prototype from LPOLESTR to LPSTR
- and the app compiled and sort of worked.
-
- I am running out of ideas, plus it does not help being the only C++ programmer
- in the office. Any help will be appreciated.
-
- Ananda
- email: ananda@mars.superlink.net
-
-
-